package com.example.hehecat.yuejian1.mvp.model;

import com.example.hehecat.yuejian1.http.RetrofitHttp;

import com.example.hehecat.yuejian1.mvp.contract.MineContract;
import com.example.hehecat.yuejian1.mvp.model.bean.SuccessBean;
import com.example.hehecat.yuejian1.mvp.model.bean.UserBean;

import okhttp3.OkHttpClient;

import retrofit2.Callback;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;


public class MineModel implements MineContract.Model {
    @Override
    public void mine(int user_id,String nickname, Subscriber<UserBean> subscriber) {
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        RetrofitHttp.getRetrofit(builder).getNickName(user_id,nickname)
                .subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber);
    }
}
